package com.liser.southernstar.model.vo;

import android.content.Context;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.AbsoluteSizeSpan;

import com.kunminx.linkage.bean.BaseGroupedItem;
import com.liser.southernstar.neleme.utils.ViewUtils;

import java.math.BigDecimal;

/**
 * 商品分组详情
 *
 * @author LISER
 * @date 2020-01-13 14:24
 */
public class GoodsGroupedItem extends BaseGroupedItem.ItemInfo {

    private String fk_biz;

    private String biz_name;

    private String fk_genre;

    private String genre_name;

    private String main_img;

    private String figure;

    private String id;

    private String name;

    private String describe;

    private BigDecimal discount;

    private BigDecimal price;

    private int selectCount;

    public GoodsGroupedItem(String title, String group) {
        super(title, group);
    }

    public String getFk_biz() {
        return fk_biz;
    }

    public void setFk_biz(String fk_biz) {
        this.fk_biz = fk_biz;
    }

    public String getBiz_name() {
        return biz_name;
    }

    public void setBiz_name(String biz_name) {
        this.biz_name = biz_name;
    }

    public String getFk_genre() {
        return fk_genre;
    }

    public void setFk_genre(String fk_genre) {
        this.fk_genre = fk_genre;
    }

    public String getGenre_name() {
        return genre_name;
    }

    public void setGenre_name(String genre_name) {
        this.genre_name = genre_name;
    }

    public String getMain_img() {
        return main_img;
    }

    public void setMain_img(String main_img) {
        this.main_img = main_img;
    }

    public String getFigure() {
        return figure;
    }

    public void setFigure(String figure) {
        this.figure = figure;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public int getSelectCount() {
        return selectCount;
    }

    public void setSelectCount(int selectCount) {
        this.selectCount = selectCount;
    }

    public SpannableString getStrPrice(Context context) {
        String priceStr = String.valueOf(getPrice());
        SpannableString spanString = new SpannableString("¥" + priceStr);
        AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
        spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        return spanString;
    }

    public SpannableString getStrPrice(Context context, BigDecimal price) {
        String priceStr = String.valueOf(price);
        SpannableString spanString = new SpannableString("¥" + priceStr);
        AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
        spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        return spanString;
    }
}

